package com.mitaotao._1_语法._3_分支._3_if判断;

import java.util.Scanner;

public class _07_判断几位数_1 {
    public static void main(String[] args) {
        System.out.println("请输入需要判断的数字：");
        Scanner scanner = new Scanner(System.in);
        int num,num2;
        num = scanner.nextInt();
        num2 = 0;

        if (num > 9999 && num < 100000){
            num2 = 5;
        } else if (num > 999 && num < 10000){
            num2 = 4;
        } else if (num > 99 && num <1000) {
            num2 = 3;
        } else if (num > 9 && num < 100) {
            num2 = 2;
        } else if (num > 0 && num < 10){
            num2 = 1;
        } else{
            System.out.println("您输入的数字不在判断范围内");
        }
        System.out.println("您输入的数字为"+num2+"位数");
        scanner.close();
    }
}
